﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Aulac.Rsc.Ems.Tags;
using Aulac.Global.Common;
using Aulac.Rsc.Ems;

namespace Aulac.Srv.Db.Data.Ems.MdcFiles
{
    public class MdcFileInfo
    {
        public static List<string> ListMdcExam = new List<string>(new string[]{tagMdcFiles.MdcFiles.MdcFilePrkID, 
            tagMdcFiles.MdcFiles.VchDate, tagMdcFiles.MdcFiles.PntPrkID, 
            tagMdcFiles.MdcFiles.PntID, tagMdcFiles.MdcFiles.PntName, 
            tagMdcFiles.MdcFiles.PntBirthday, tagMdcFiles.MdcFiles.PntBirthYear, 
            tagMdcFiles.MdcFiles.PntAge, tagMdcFiles.MdcFiles.PntUnitAgeID, 
            tagMdcFiles.MdcFiles.PntAddr, tagMdcFiles.MdcFiles.PntRacePrkID, tagMdcFiles.MdcFiles.PntSexID, 
            tagMdcFiles.MdcFiles.PntTownWardPrkID, tagMdcFiles.MdcFiles.PntDistrictPrkID, 
            tagMdcFiles.MdcFiles.PntProvincePrkID, tagMdcFiles.MdcFiles.PntCountryPrkID, 
            tagMdcFiles.MdcFiles.PntJobGrpPrkID, tagMdcFiles.MdcFiles.PntPlaceWork, tagMdcFiles.MdcFiles.PntPhone, 
            tagMdcFiles.MdcFiles.PntContact, tagMdcFiles.MdcFiles.ContactTitle, tagMdcFiles.MdcFiles.IcdPrsntID, 
            tagMdcFiles.MdcFiles.IcdPrsntName, tagMdcFiles.MdcFiles.DeptInPrkID, tagMdcFiles.MdcFiles.DateTimeExam, 
            tagMdcFiles.MdcFiles.IsActive, tagMdcFiles.MdcFiles.TranFromOfficeCode, 
            tagMdcFiles.MdcFiles.TranFromOfficeName, tagMdcFiles.MdcFiles.TranFromHspTypeID,  tagMdcFiles.MdcFiles.PntTownWardName, 
            tagMdcFiles.MdcFiles.PntDistrictName, tagMdcFiles.MdcFiles.PntProvinceName, tagMdcFiles.MdcFiles.PntCountryName, tagMdcFiles.MdcFiles.IsKcbDgTuyen, tagMdcFiles.MdcFiles.IsPntEmergency,  tagMdcFiles.MdcFiles.FncStylePntPrkID});

        public  static List<string> mListPntInfo = new List<string>(new string[] { tagMdcFiles.Pnt.PntPrkID, tagMdcFiles.Pnt.PntID, tagMdcFiles.Pnt.PntName, tagMdcFiles.Pnt.PntBirthday, tagMdcFiles.Pnt.PntBirthYear, tagMdcFiles.Pnt.PntAddr, tagMdcFiles.Pnt.PntRacePrkID, tagMdcFiles.Pnt.PntSexID, tagMdcFiles.Pnt.PntTownWardPrkID, tagMdcFiles.Pnt.PntDistrictPrkID, tagMdcFiles.Pnt.PntProvincePrkID, tagMdcFiles.Pnt.PntCountryPrkID, tagMdcFiles.Pnt.PntJobGrpPrkID, tagMdcFiles.Pnt.PntPlaceWork, tagMdcFiles.Pnt.PntPhone, tagMdcFiles.Pnt.InsNum, tagMdcFiles.Pnt.InsDate, tagMdcFiles.Pnt.InsExpireDate, tagMdcFiles.Pnt.IsActive });


        /// <summary>
        /// Lay che do KCB trong Benh an KCB
        /// </summary>
        /// <param name="pDbPrd">Doi tuong truy van</param>
        /// <param name="pMdcFilePrkID">ID Benh an</param>
        public static string GetFncStylePnt(Aulac.Srv.Db.Provider.IDbDataProvider pDbPrd, string pMdcFilePrkID)
        {
            /*** Other Write: Thangnc ***/
            /*** Code Date: 09/17/2010 ***/

            MdcFilePntProfile prl = GetProfilePnt(pDbPrd, pMdcFilePrkID);
            if (prl != null)
                return prl.FncStylePntPrkID;
            else return "";
        }
        
        /// <summary>
        /// Lay thong tin Bn de tinh gia chi phi KCB
        /// </summary>
        /// <param name="pDbPrd">Doi tuong truy van</param>
        /// <param name="pMdcFilePrkID">ID benh an</param>
        /// <param name="pPntRdcObjPrkID">Id doi tuong KCB</param>
        /// <returns>MdcFileProfile</returns>
        public static MdcFilePntProfile GetProfilePnt(Aulac.Srv.Db.Provider.IDbDataProvider pDbPrd, string pMdcFilePrkID, string pPntRdcObjPrkID)
        {
            /*** Other Write: Thangnc ***/
            /*** Code Date: 09/17/2010 ***/

            return new MdcFileInfoDb(pDbPrd).GetProfilePntDb(pMdcFilePrkID, pPntRdcObjPrkID);
        }
        /// <summary>
        ///  Lay thong tin Bn de tinh gia chi phi KCB
        /// </summary>
        /// <param name="pDbPrd">Doi tuong truy van</param>
        /// <param name="pMdcFilePrkID">ID benh an</param>
        /// <returns>MdcFileProfile</returns>
        public static MdcFilePntProfile GetProfilePnt(Aulac.Srv.Db.Provider.IDbDataProvider pDbPrd, string pMdcFilePrkID)
        {
            /*** Other Write: Thangnc ***/
            /*** Code Date: 09/17/2010 ***/

            return new MdcFileInfoDb(pDbPrd).GetProfilePntDb(pMdcFilePrkID, "");
        }
    }

    public class MdcFilePntProfile
    {
        /*** Other Write: Thangnc ***/
        /*** Code Date: 09/17/2010 ***/

        public string MdcFilePrkID = "";
        public string PntPrkID = "";
        public string PntRdcObjPrkID = "";
        public bool IsKcbDgTuyen = true;
        public bool IsPntEmergency = false;
        public string FncStylePntPrkID =  "";
        public bool IsValidIns = true;
    }
}
